/**
 * Created by levy on 16/6/15.
 */
/**
 * show: 有值时(不为false), 显示; 一秒后消失
 * style: {key:value}, 自定义样式
 */
var Developing = React.createClass({
    getInitialState() {
        return {
            show: ''
        }
    },
    render() {
        return(
            <div className={"developing " + this.state.show} style={this.props.style || {}}>
                <p className="text">
                    功能建设中...
                </p>
            </div>
        )
    },
    componentWillReceiveProps(nextProps) {
        if(!nextProps.show || nextProps.show == false) return;

        var me = this;

        //console.log('show')
        //setTimeout 不执行完毕, 该函数不会再次执行
        me.setState({show: 'show'}, function () {
            setTimeout(function () {
                me.setState({show: ''});
            }, 1000);
        });

    }
});

export default Developing;


